package top.riske.animalhazardassessment.common.http.request;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import top.riske.animalhazardassessment.common.entity.Analyse;
import top.riske.animalhazardassessment.common.entity.Animal;

@Data
public class AnalyseRequest {

    @Schema(description = "动物头像链接")
    private String avatar;

    /**
     * 动物名
     */
    @Schema(description = "动物名")
    private String animalName;

    /**
     * 年龄
     */
    @Schema(description = "动物年龄")
    private Integer animalAge;

    /**
     * 物种id
     */
    @Schema(description = "物种id")
    private Long speciesId;

    /**
     * 是否牵狗绳
     */
    @Schema(description = "是否牵狗绳")
    private Boolean towline;

    /**
     * 健康状态
     */
    @Schema(description = "健康状况，0-健康，1-生病")
    private Integer healthy;

    @Schema(description = "动物体格,0-微型，1-小型，2-中型，3-大型")
    private Integer physique;

    @Schema(description = "护食程度,0-无，1-低吼，2-龇牙，3-扑咬")
    private Integer protectFood;

    @Schema(description = "是否已打过疫苗")
    private Boolean vaccines;


    public Animal toAnimal(){
        Animal animal = new Animal();
        animal.setAvatar(avatar);
        animal.setName(animalName);
        return animal;
    }

    public Analyse toAnalyse(){
        Analyse analyse = new Analyse();
        analyse.setAvatar(avatar);
        analyse.setAnimalName(animalName);
        analyse.setAnimalAge(animalAge);
        analyse.setSpeciesId(speciesId);
        analyse.setTowline(towline);
        analyse.setHealthy(healthy);
        analyse.setPhysique(physique);
        analyse.setProtectFood(protectFood);
        analyse.setVaccines(vaccines);
        return analyse;
    }

    public AnalyseRequest() {
    }
}
